module ogre.light;

import dogre.internals.utils;
import dogre.vector3;
import dogre.colourvalue;

extern(C)
{
	void call_Light_setPosition(void* ptr, float x, float y, float z);
    void call_Light_setType(void* ptr, Light.LightTypes type);
    void call_setDiffuseColour(void* ptr, float r, float g, float b);
    void call_setSpecularColour(void* ptr, float r, float g, float b);
    void call_Light_setDirection(void* ptr, float x, float y, float z);
    void call_setSpotlightRange(void* ptr, void* innerAngle, void* outerAngle, float falloff);
}

class Light
{
	mixin(Wrapper);
	
	void setPosition(float x, float y, float z)
	{
		call_Light_setPosition(p, x, y, z);
	}
    
    void setPosition(Vector3 pos)
    {
        call_Light_setPosition(p, pos.x, pos.y, pos.z);
    }
    
    void setDirection(float x, float y, float z)
	{
		call_Light_setDirection(p, x, y, z);
	}
    
    void setDirection(Vector3 pos)
    {
        call_Light_setDirection(p, pos.x, pos.y, pos.z);
    }
    
    void setType(Light.LightTypes type)
    {
        call_Light_setType(p, type);
    }
    
    enum
    {
        LT_POINT = 0,
        LT_DIRECTIONAL = 1,
        LT_SPOTLIGHT = 2
    }
    alias int LightTypes;
    
    void setSpecularColour(float r, float g, float b)
    {
        call_setSpecularColour(p, r, g, b);
    }
    
    void setDiffuseColour(float r, float g, float b)
    {
        call_setDiffuseColour(p, r, g, b);
    }
    
    void setSpecularColour(ColourValue colour)
    {
        call_setSpecularColour(p, colour.r, colour.g, colour.b);
    }
    
    void setDiffuseColour(ColourValue colour)
    {
        call_setDiffuseColour(p, colour.r, colour.g, colour.b);
    }
    
    void setSpotlightRange(AngleMeasurement innerAngle, AngleMeasurement outerAngle, float falloff = 1.0)
    {
        call_setSpotlightRange(p, innerAngle.asRadians(), outerAngle.asRadians(), falloff);
    }
}